/*
 * @Author: your name
 * @Date: 2020-08-05 15:22:49
 * @LastEditTime: 2020-08-10 09:58:54
 * @LastEditors: Please set LastEditors
 * @Description: 成语对象
 * @FilePath: \shici_demo\assets\Script\game\obj\data.ts
 */

export class Idiom{
    public lvId: number = 0;                        // 关卡id
    public idiomData: string = undefined;           // 成语数据
    public poemData: string = undefined;            // 诗词数据
    public posArr: Array<number> = [];              // 成语四字的格子位置

    constructor(targetPos: number, charPosArr: Array<number>) {
        let _pos: Array<number> = [];
        for (let i = 0; i < charPosArr.length; i++) {
            _pos.push(targetPos + charPosArr[i] * 9);
        }
        this.posArr = _pos;
    }

    public init(lvid: number, idiomdata: string, poemdata: string) {
        this.lvId = lvid;
        this.idiomData = idiomdata;
        this.poemData = poemdata;
    }

}